package 每日一题;

public class 计算力扣银行的钱 {
    public int totalMoney(int n) {
        int week = n/7;
        int start = week+1;
        int end = n % 7;
        int money = 0;
        for (int i = 0; i < week; i++) {
            for (int j = 1; j <=7; j++) {
                money +=(i+j);
            }
        }
        for (int i = start; i < start+end; i++) {
            money += i;
        }
        return money;
    }
}
